package com.slz3.business.module.goodsManagement.gooInventory.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooInventory.domain.GooInventory;
import com.slz3.business.module.goodsManagement.gooInventory.domain.GooInventoryCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class GooInventoryResController extends GooInventoryResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, GooInventory gooInventory) {
        if (GooInventoryResUnsafeValid.add(req, gooInventory)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$GooInventoryUpdateLock(req, gooInventory);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.delete(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooInventory gooInventory) {
        if (GooInventoryResUnsafeValid.modify(req, gooInventory)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$GooInventoryUpdateLock(req, gooInventory);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooInventoryResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return gooInventoryResAtomic.info_$GooInventoryUpdateLock(req);
        if (GooInventoryResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$GooInventoryUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooInventoryResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        //
        if (GooInventoryResUnsafeValid.auditSubmit(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.audit(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.auditReject(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.usingEnable(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.usingDisable(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

    public Mono<ServerResponse> sync(ServerRequest req, GooInventoryCondition gooInventoryCondition) {
        if (GooInventoryResUnsafeValid.sync(req, gooInventoryCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.sync_$GooInventoryUpdateLock(req, gooInventoryCondition);
        }
    }

}
